--[[ 编码: WMS-20-24 名称: 入库单-清空和入库相关的数据 作者:HAN 日期:2025-1-29 级别:固定 (说明本段代码在项目中不太会变化) 函数: ResetInbound 功能: 清除所有和入库业务相关的数据,包括 -- 入库单 -- 入库单明细 -- 入库波次 -- 波次组成 -- 入库波次明细 -- 预分配容器 -- 组盘明细 更改记录: --]] json = require ("json") mobox = require ("OILua_JavelinExt") m3 = require("oi_base_mobox") function ResetInbound( strLuaDEID ) local nRet, strRetInfo local strCondition = "" nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Inbound_Order") if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Inbound_Order】失败!"..strRetInfo) end nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Inbound_Detail") if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Inbound_Detail】失败!"..strRetInfo) end nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Inbound_Wave") if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Inbound_Wave】失败!"..strRetInfo) end nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "IW_Compose") if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【IW_Compose】失败!"..strRetInfo) end nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "IW_Detail") if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【IW_Detail】失败!"..strRetInfo) end -- 和组盘相关 nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Pre_Alloc_Container") if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Pre_Alloc_Container】失败!"..strRetInfo) end nRet, strRetInfo = mobox.dbClearData(strLuaDEID, "Pre_Alloc_CNTR_Detail") if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【Pre_Alloc_CNTR_Detail】失败!"..strRetInfo) end local action = { { action_type = "refresh", value = "" } } nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str( action )) if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction错误: "..strRetInfo) end end